//
//  GRRefusedCell.m
//  test
//
//  Created by 李彦宏 on 2018/3/12.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "GRRefusedCell.h"

@implementation GRRefusedCell


//类方法快速创建cell
+(instancetype)cellwithTableview:(UITableView *)tableview{
    
    // 1.创建cell
    static NSString *ID = @"cell100";
    GRRefusedCell *cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[GRRefusedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return  cell;
    
}
/**
 *  cell的初始化方法，一个cell只会调用一次
 *  一般在这里添加所有可能显示的子控件，以及子控件的一次性设置
 */
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI控件
        [self setUI];
    }
    return self;
}
-(void)setUI{
    UILabel *satelable=[[UILabel alloc] init];
    [satelable setBackgroundColor:[UIColor clearColor]];
    [satelable setTextColor:[UIColor blackColor]];
    [satelable setFont:[UIFont systemFontOfSize:14]];
    satelable.textAlignment=NSTextAlignmentCenter;
    satelable.text=@"2018/03/20-12:30";
    satelable.numberOfLines=0;
    self.data=satelable;
    [self.contentView addSubview:satelable];
    satelable.frame = CGRectMake(0, 0, 75, 44);
    
    UILabel *lb1=[[UILabel alloc] init];
    [lb1 setBackgroundColor:[UIColor clearColor]];
    [lb1 setTextColor:XGColor];
    [lb1 setFont:[UIFont systemFontOfSize:14]];
    lb1.textAlignment=NSTextAlignmentCenter;
    lb1.text=@"已拒绝";
    [self.contentView addSubview:lb1];
    lb1.frame = CGRectMake(ScreenWidth/2-30, 8, 60, 25);
    
    UIButton *lbtn = [[UIButton alloc]init];
    [lbtn setFrame:CGRectMake(ScreenWidth-50, 6, 40, 30)];
    [lbtn setTitle:@"查看" forState:UIControlStateNormal];
    [lbtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [lbtn setBackgroundColor:dominantColor];
    lbtn.showsTouchWhenHighlighted=YES;
    self.LookBtn=lbtn;
    [lbtn addTarget:self action:@selector(BtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:lbtn];
    
    
}
-(void)BtnAction:(UIButton *)send{

    self.BUttonBlock();

}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
